package org.huntaway.manager.dao;

import java.io.File;

import org.hibernate.Session;
import org.huntaway.hibernate.imp.HibernateUtil;
import org.huntaway.manager.po.SysFile;

public class App 
{
    public static void main( String[] args )
    {
        System.out.println("Maven + Hibernate + MySQL");
        Session session = HibernateUtil.getSessionFactory().openSession();
        
        session.beginTransaction();
        File file1=new File("I:\\10.rar");
        //SysFileDAO 
        SysFile sysFile = new SysFile();
        
        sysFile.setName(file1.getName());
        sysFile.setParent(file1.getParent());
        sysFile.setPath(file1.getPath());
        
        session.save(sysFile);
       
        
        
        //session.delete(stock);
        
        session.getTransaction().commit();
        
        
    }
}
